import {REACT_TEXT} from './constants';

/**
 * 为了方便后面的DOM-DFF, 我把文本节点进行单独的封装或则说标识
 * @param element
 * @returns {{type: symbol, props: {content: (string|number)}}|*}
 */
export function wrapToVdom(element) {
  return (typeof element === 'string' || typeof element === 'number') ?
    {type: REACT_TEXT,props:{content:element}} :
    element;
}
